package cn.xiaoyuan.controller.api;

import cn.xiaoyuan.service.AdminService;
import cn.xiaoyuan.service.SellService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RequestMapping("/api/admin")
@Controller
public class AdminApiController {
    @Resource
    AdminService adminService;
    @Resource
    SellService sellService;
    @GetMapping("/del_sell/{id}")
    public String del_sell(@PathVariable("id") int id){
        sellService.delSell(id);
        return "redirect:/page/admin/orders";
    }
    @GetMapping("/forbidden/{id}")
    public String forbidden(@PathVariable("id") int id){
        adminService.forBidden(id);
        return "redirect:/page/admin/userList";
    }
    @GetMapping("/formal/{id}")
    public String formal(@PathVariable("id")int id){
        adminService.formal(id);
        return "redirect:/page/admin/userList";
    }

}
